//
//  CALayer+Category.m
//  DCProject
//
//  Created by bigbing on 2019/4/8.
//  Copyright © 2019 bigbing. All rights reserved.
//

#import "CALayer+Category.h"

@implementation CALayer (Category)

- (void)setBorderColorFromUIColor:(UIColor *)color{
    self.borderColor = color.CGColor;
}


#pragma mark - 渐变色
+ (CAGradientLayer *)dc_gradientColorWidthFrame:(CGRect)frame startPoint:(CGPoint)startPoint endPoint:(CGPoint)endPoint colors:(NSArray *)colors locations:(NSArray<NSNumber *> *)locations
{
    // gradient
    CAGradientLayer *gl = [CAGradientLayer layer];
    gl.frame = frame;
    gl.startPoint = startPoint;
    gl.endPoint = endPoint;
    gl.colors = colors;
    gl.locations = locations;
    return gl;
}

@end
